new Promise((resolve, reject) => {
  resolve((() => {
    console.log(1)
    return 2
  })())
  console.log(3)
}).then((arg) => {
  console.log(arg)
})

setTimeout(() => {
  console.log(4);
}, 0);

console.log(5);


// 1 3 5 2 4


/* ***** */
Promise.resolve().then(() => {
  console.log('a')
  setTimeout(() => {
    console.log('b')
  },0)
})

setTimeout(() => {
  console.log('c')
  Promise.resolve().then(() => {
    console.log('d')
  })
}, 0)

console.log('e')

// e  a  c  d  b

//1  3 5  e  2  a  4  c  d  b  